RNA-Seq: TFA analysis of SC Controls
Libraries required
Data
TFA analysis
Transcription Factor Binding Affinity analysis is performed using Virtual Inference of Protein-activity by Enriched Regulon analysis (VIPER) algorithm.
Regulon is a group of genes that are regulated as a unit, generally controlled by the same regulatory gene that expresses a protein acting as a repressor or activator.
More details: 10.1038/ng.3593
Function to show table
make_DT <- function(tab) {
df <- data.frame(TF = rownames(tab), tab, check.names = F, stringsAsFactors = F)
DT::datatable(
df,
rownames = F,
filter = "top", extensions = c("Buttons", "ColReorder"), options = list(
autoWidth = TRUE,
columnDefs = list(list(
# targets = 12:13,
render = JS(
"function(data, type, row, meta) {",
"return type === 'display' && data.length > 8 ?",
"'<span title=\"' + data + '\">' + data.substr(0, 8) + '...</span>' : data;",
"}"
)
)),
pageLength = 10,
buttons = c("copy", "csv", "excel", "pdf", "print"),
colReorder = list(realtime = FALSE),
dom = "fltBip"
)
)
}Filters a viper regulon by likelihood
TFA analysis
Function for running analysis
runTFA <- function(voomEL, dea, pData, pDataCol, group1, group2, regulon) {
s1 <- rownames(pData[pData[, pDataCol] == group1, ])
s2 <- rownames(pData[pData[, pDataCol] == group2, ])
se <- voomEList$E[, c(s2, s1)]
pData <- pData[colnames(se), ]
design <- model.matrix(~ 0 + Group, pData)
tfa <- TFA(se = se, dea = dea, design = design, regulon = regulon)
colData(tfa) <- DataFrame(pData)
return(tfa)
}All regulons
tfa.all.pnd8_pnd15 <- runTFA(
voomEL = voomEList, dea = dea.list$`PND8 vs PND15`,
pData = salmon@phenoData, pDataCol = "Group",
group1 = "PND8", group2 = "PND15",
regulon = regulon.curated.mm
)
tfa.all.pnd15_adult <- runTFA(
voomEL = voomEList, dea = dea.list$`PND15 vs Adult`,
pData = salmon@phenoData, pDataCol = "Group",
group1 = "PND15", group2 = "Adult",
regulon = regulon.curated.mm
)Filtered regulons
tfa.filt.pnd8_pnd15 <- runTFA(
voomEL = voomEList, dea = dea.list$`PND8 vs PND15`,
pData = salmon@phenoData, pDataCol = "Group",
group1 = "PND8", group2 = "PND15",
regulon = regulon.mm10
)
tfa.filt.pnd15_adult <- runTFA(
voomEL = voomEList, dea = dea.list$`PND15 vs Adult`,
pData = salmon@phenoData, pDataCol = "Group",
group1 = "PND15", group2 = "Adult",
regulon = regulon.mm10
)Results
Volcano plots
All regulons
p <- subplot(plotTFA(tfa.all.pnd8_pnd15) %>%
layout(
xaxis = list(range = c(-10, 10)), yaxis = list(range = c(-1, 32)),
font = list(size = 17)
),
plotTFA(tfa.all.pnd15_adult) %>%
layout(
xaxis = list(range = c(-10, 10)), yaxis = list(range = c(-1, 32)),
font = list(size = 17)
),
nrows = 2, shareX = T, shareY = T, titleX = T, titleY = T
)
p %>% layout(title = "", annotations = list(
list(
x = 0.5, y = 1.00, text = "PND8 vs PND15", showarrow = F, xref = "paper", yref = "paper",
font = list(color = "red", family = "Arial", size = 20)
),
list(
x = 0.5, y = 0.5, text = "PND15 vs Adult", showarrow = F, xref = "paper", yref = "paper",
font = list(color = "red", family = "Arial", size = 20)
)
), showlegend = FALSE)Filtered regulons
p <- subplot(plotTFA(tfa.filt.pnd8_pnd15) %>%
layout(
xaxis = list(range = c(-10, 10)), yaxis = list(range = c(-1, 32)),
font = list(size = 17)
),
plotTFA(tfa.filt.pnd15_adult) %>%
layout(
xaxis = list(range = c(-10, 10)), yaxis = list(range = c(-1, 32)),
font = list(size = 17)
),
nrows = 2, shareX = T, shareY = T, titleX = T, titleY = T
)
p %>% layout(title = "", annotations = list(
list(
x = 0.5, y = 1.04, text = "PND8 vs PND15", showarrow = F, xref = "paper", yref = "paper",
font = list(color = "red", family = "Arial", size = 20)
),
list(
x = 0.5, y = 0.5, text = "PND15 vs Adult", showarrow = F, xref = "paper", yref = "paper",
font = list(color = "red", family = "Arial", size = 20)
)
), showlegend = FALSE)UpSetPlot
All regulons
tfa.all.union <- Reduce(
union,
list(
rownames(rowData(tfa.all.pnd8_pnd15)[rowData(tfa.all.pnd8_pnd15)[, "activity.FDR"] <= 0.05, ]),
rownames(rowData(tfa.all.pnd15_adult)[rowData(tfa.all.pnd15_adult)[, "activity.FDR"] <= 0.05, ])
)
)
tfa.all.upset <- data.frame(
TF = tfa.all.union, `PND8 vs PND15` = 0, `PND15 vs Adult` = 0,
check.names = F, stringsAsFactors = F
)
rownames(tfa.all.upset) <- tfa.all.upset$TF
tfa.all.upset[rownames(rowData(tfa.all.pnd8_pnd15)[rowData(tfa.all.pnd8_pnd15)[, "activity.FDR"] <= 0.05, ]), 2] <- 1
tfa.all.upset[rownames(rowData(tfa.all.pnd15_adult)[rowData(tfa.all.pnd15_adult)[, "activity.FDR"] <= 0.05, ]), 3] <- 1
col <- brewer.pal(7, "Set1")
upset(tfa.all.upset[, 2:3],
point.size = 5, sets.bar.color = col[1:2], matrix.color = col[5],
order.by = "freq", set_size.numbers_size = T, text.scale = c(2.5, 3, 2.5, 2.5, 2.5, 3)
)grid.arrange(
grobs = list(
vp
),
top = "TFA in SC at different stages of development (FDR <= 0.05)",
cols = 1
)grid.arrange(
grobs = list(
vp
),
top = "TFA in SC at different stages of development (FDR <= 0.05)",
cols = 1
)Filtered regulons
tfa.filt.union <- Reduce(
union,
list(
rownames(rowData(tfa.filt.pnd8_pnd15)[rowData(tfa.filt.pnd8_pnd15)[, "activity.FDR"] <= 0.05, ]),
rownames(rowData(tfa.filt.pnd15_adult)[rowData(tfa.filt.pnd15_adult)[, "activity.FDR"] <= 0.05, ])
)
)
tfa.filt.upset <- data.frame(
TF = tfa.filt.union, `PND8 vs PND15` = 0, `PND15 vs Adult` = 0,
check.names = F, stringsAsFactors = F
)
rownames(tfa.filt.upset) <- tfa.filt.upset$TF
tfa.filt.upset[rownames(rowData(tfa.filt.pnd8_pnd15)[rowData(tfa.filt.pnd8_pnd15)[, "activity.FDR"] <= 0.05, ]), 2] <- 1
tfa.filt.upset[rownames(rowData(tfa.filt.pnd15_adult)[rowData(tfa.filt.pnd15_adult)[, "activity.FDR"] <= 0.05, ]), 3] <- 1
col <- brewer.pal(7, "Set1")
upset(tfa.filt.upset[, 2:3],
point.size = 5, sets.bar.color = col[1:2], matrix.color = col[5],
order.by = "freq", set_size.numbers_size = T, text.scale = c(2.5, 3, 2.5, 2.5, 2.5, 3)
)grid.arrange(
grobs = list(
vp
),
top = "TFA in SC at different stages of development (FDR <= 0.05)",
cols = 1
)grid.arrange(
grobs = list(
vp
),
top = "TFA in SC at different stages of development (FDR <= 0.05)",
cols = 1
)Heatmaps of TBA
Data prep
All regulons
tfa.all.pnd8_pnd15 <- tfa.all.pnd8_pnd15[, c(
grep(pattern = "PND8", x = colnames(tfa.all.pnd8_pnd15), value = T),
grep(pattern = "PND15", x = colnames(tfa.all.pnd8_pnd15), value = T)
)]
# rowData(tfa.all$`PND8 vs PND15`) <- rowData(tfa.all$`PND8 vs PND15`)[order(rowData(tfa.all$`PND8 vs PND15`)[, "activity.FDR"]), ]
tfa.all.pnd15_adult <- tfa.all.pnd15_adult[, c(
grep(pattern = "PND15", x = colnames(tfa.all.pnd15_adult), value = T),
grep(pattern = "Adult", x = colnames(tfa.all.pnd15_adult), value = T)
)]
# rowData(tfa$`PND15 vs Adult`) <- rowData(tfa$`PND15 vs Adult`)[order(rowData(tfa$`PND15 vs Adult`)[, 11]), ]Filtered regulons
tfa.filt.pnd8_pnd15 <- tfa.filt.pnd8_pnd15[, c(
grep(pattern = "PND8", x = colnames(tfa.filt.pnd8_pnd15), value = ),
grep(pattern = "PND15", x = colnames(tfa.filt.pnd8_pnd15), value = )
)]
# rowData(tfa$`PND8 vs PND15`) <- rowData(tfa$`PND8 vs PND15`)[order(rowData(tfa$`PND8 vs PND15`)[, 11]), ]
tfa.filt.pnd15_adult <- tfa.filt.pnd15_adult[, c(
grep(pattern = "PND15", x = colnames(tfa.filt.pnd15_adult), value = ),
grep(pattern = "Adult", x = colnames(tfa.filt.pnd15_adult), value = )
)]
# rowData(tfa$`PND8 vs Adult`) <- rowData(tfa$`PND8 vs Adult`)[order(rowData(tfa$`PND8 vs Adult`)[, 11]), ]Heatmaps
All regulons
PND8 vs PND15
sehm(
hmcols = viridis::viridis(1000), se = tfa.filt.pnd8_pnd15[1:20, ],
anno_columns = c("Group", "Cage.ID", "Batch"), scale = "row",
anno_rows = c("activity.logFC", "activity.FDR", "targetEnrichment", "targetEnrFDR")
)## Registered S3 method overwritten by 'seriation':
## method from
## reorder.hclust gclus
Tables
All regulons
PND8 vs PND15
PND15 vs Adult
Filtered regulons
PND8 vs PND15
PND15 vs Adult
SessionInfo
## ─ Session info ──────────────────────────────────────────────────────────
## setting value
## version R version 3.6.1 (2019-07-05)
## os Ubuntu 16.04.6 LTS
## system x86_64, linux-gnu
## ui X11
## language (EN)
## collate de_DE.UTF-8
## ctype de_DE.UTF-8
## tz Europe/Zurich
## date 2019-08-20
##
## ─ Packages ──────────────────────────────────────────────────────────────
## package * version date lib source
## acepack 1.4.1 2016-10-29 [1] CRAN (R 3.6.1)
## annotate 1.62.0 2019-05-02 [1] Bioconductor
## AnnotationDbi 1.46.0 2019-05-02 [1] Bioconductor
## assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.1)
## backports 1.1.4 2019-04-10 [1] CRAN (R 3.6.1)
## base64enc 0.1-3 2015-07-28 [1] CRAN (R 3.6.1)
## Biobase * 2.44.0 2019-05-02 [1] Bioconductor
## BiocGenerics * 0.30.0 2019-05-02 [1] Bioconductor
## BiocParallel * 1.18.1 2019-08-06 [1] Bioconductor
## Biostrings 2.52.0 2019-05-02 [1] Bioconductor
## bit 1.1-14 2018-05-29 [1] CRAN (R 3.6.1)
## bit64 0.9-7 2017-05-08 [1] CRAN (R 3.6.1)
## bitops 1.0-6 2013-08-17 [1] CRAN (R 3.6.1)
## blob 1.2.0 2019-07-09 [1] CRAN (R 3.6.1)
## bookdown 0.12 2019-07-11 [1] CRAN (R 3.6.1)
## callr 3.3.1 2019-07-18 [1] CRAN (R 3.6.1)
## caTools 1.17.1.2 2019-03-06 [1] CRAN (R 3.6.1)
## checkmate 1.9.4 2019-07-04 [1] CRAN (R 3.6.1)
## class 7.3-15 2019-01-01 [1] CRAN (R 3.6.1)
## cli 1.1.0 2019-03-19 [1] CRAN (R 3.6.1)
## cluster 2.1.0 2019-06-19 [1] CRAN (R 3.6.1)
## codetools 0.2-16 2018-12-24 [1] CRAN (R 3.6.1)
## colorspace 1.4-1 2019-03-18 [1] CRAN (R 3.6.1)
## crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.1)
## crosstalk 1.0.0 2016-12-21 [1] CRAN (R 3.6.1)
## data.table 1.12.2 2019-04-07 [1] CRAN (R 3.6.1)
## DBI 1.0.0 2018-05-02 [1] CRAN (R 3.6.1)
## DelayedArray * 0.10.0 2019-05-02 [1] Bioconductor
## dendextend 1.12.0 2019-05-11 [1] CRAN (R 3.6.1)
## desc 1.2.0 2018-05-01 [1] CRAN (R 3.6.1)
## DESeq2 1.24.0 2019-05-02 [1] Bioconductor
## devtools 2.1.0 2019-07-06 [1] CRAN (R 3.6.1)
## digest 0.6.20 2019-07-04 [1] CRAN (R 3.6.1)
## dplyr 0.8.3 2019-07-04 [1] CRAN (R 3.6.1)
## DT * 0.8 2019-08-07 [1] CRAN (R 3.6.1)
## e1071 1.7-2 2019-06-05 [1] CRAN (R 3.6.1)
## edgeR * 3.26.7 2019-08-13 [1] Bioconductor
## evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.1)
## foreach 1.4.7 2019-07-27 [1] CRAN (R 3.6.1)
## foreign 0.8-72 2019-08-02 [1] CRAN (R 3.6.1)
## Formula 1.2-3 2018-05-03 [1] CRAN (R 3.6.1)
## fs 1.3.1 2019-05-06 [1] CRAN (R 3.6.1)
## gclus 1.3.2 2019-01-07 [1] CRAN (R 3.6.1)
## gdata 2.18.0 2017-06-06 [1] CRAN (R 3.6.1)
## genefilter 1.66.0 2019-05-02 [1] Bioconductor
## geneplotter 1.62.0 2019-05-02 [1] Bioconductor
## GenomeInfoDb * 1.20.0 2019-05-02 [1] Bioconductor
## GenomeInfoDbData 1.2.1 2019-07-24 [1] Bioconductor
## GenomicRanges * 1.36.0 2019-05-02 [1] Bioconductor
## GEOquery 2.52.0 2019-05-02 [1] Bioconductor
## ggplot2 * 3.2.1 2019-08-10 [1] CRAN (R 3.6.1)
## glue 1.3.1 2019-03-12 [1] CRAN (R 3.6.1)
## gplots 3.0.1.1 2019-01-27 [1] CRAN (R 3.6.1)
## gridExtra * 2.3 2017-09-09 [1] CRAN (R 3.6.1)
## gtable 0.3.0 2019-03-25 [1] CRAN (R 3.6.1)
## gtools 3.8.1 2018-06-26 [1] CRAN (R 3.6.1)
## highr 0.8 2019-03-20 [1] CRAN (R 3.6.1)
## Hmisc 4.2-0 2019-01-26 [1] CRAN (R 3.6.1)
## hms 0.5.0 2019-07-09 [1] CRAN (R 3.6.1)
## htmlTable 1.13.1 2019-01-07 [1] CRAN (R 3.6.1)
## htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.6.1)
## htmlwidgets 1.3 2018-09-30 [1] CRAN (R 3.6.1)
## httpuv 1.5.1 2019-04-05 [1] CRAN (R 3.6.1)
## httr 1.4.1 2019-08-05 [1] CRAN (R 3.6.1)
## IRanges * 2.18.1 2019-05-31 [1] Bioconductor
## iterators 1.0.12 2019-07-26 [1] CRAN (R 3.6.1)
## jsonlite 1.6 2018-12-07 [1] CRAN (R 3.6.1)
## KernSmooth 2.23-15 2015-06-29 [1] CRAN (R 3.6.1)
## knitr 1.24 2019-08-08 [1] CRAN (R 3.6.1)
## labeling 0.3 2014-08-23 [1] CRAN (R 3.6.1)
## later 0.8.0 2019-02-11 [1] CRAN (R 3.6.1)
## lattice 0.20-38 2018-11-04 [1] CRAN (R 3.6.1)
## latticeExtra 0.6-28 2016-02-09 [1] CRAN (R 3.6.1)
## lazyeval 0.2.2 2019-03-15 [1] CRAN (R 3.6.1)
## limma * 3.40.6 2019-07-26 [1] Bioconductor
## locfit 1.5-9.1 2013-04-20 [1] CRAN (R 3.6.1)
## magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.1)
## MASS 7.3-51.4 2019-04-26 [1] CRAN (R 3.6.1)
## Matrix 1.2-17 2019-03-22 [1] CRAN (R 3.6.1)
## matrixStats * 0.54.0 2018-07-23 [1] CRAN (R 3.6.1)
## memoise 1.1.0 2017-04-21 [1] CRAN (R 3.6.1)
## mime 0.7 2019-06-11 [1] CRAN (R 3.6.1)
## miniUI 0.1.1.1 2018-05-18 [1] CRAN (R 3.6.1)
## mixtools 1.1.0 2017-03-10 [1] CRAN (R 3.6.1)
## munsell 0.5.0 2018-06-12 [1] CRAN (R 3.6.1)
## nnet 7.3-12 2016-02-02 [1] CRAN (R 3.6.1)
## pheatmap * 1.0.12 2019-01-04 [1] CRAN (R 3.6.1)
## pillar 1.4.2 2019-06-29 [1] CRAN (R 3.6.1)
## pkgbuild 1.0.4 2019-08-05 [1] CRAN (R 3.6.1)
## pkgconfig 2.0.2 2018-08-16 [1] CRAN (R 3.6.1)
## pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.6.1)
## plgINS * 0.1.5 2019-08-14 [1] local
## plotly * 4.9.0 2019-04-10 [1] CRAN (R 3.6.1)
## plyr 1.8.4 2016-06-08 [1] CRAN (R 3.6.1)
## prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.6.1)
## processx 3.4.1 2019-07-18 [1] CRAN (R 3.6.1)
## promises 1.0.1 2018-04-13 [1] CRAN (R 3.6.1)
## ps 1.3.0 2018-12-21 [1] CRAN (R 3.6.1)
## purrr 0.3.2 2019-03-15 [1] CRAN (R 3.6.1)
## questionr 0.7.0 2018-11-26 [1] CRAN (R 3.6.1)
## R6 2.4.0 2019-02-14 [1] CRAN (R 3.6.1)
## RColorBrewer * 1.1-2 2014-12-07 [1] CRAN (R 3.6.1)
## Rcpp 1.0.2 2019-07-25 [1] CRAN (R 3.6.1)
## RCurl 1.95-4.12 2019-03-04 [1] CRAN (R 3.6.1)
## readr 1.3.1 2018-12-21 [1] CRAN (R 3.6.1)
## registry 0.5-1 2019-03-05 [1] CRAN (R 3.6.1)
## remotes 2.1.0 2019-06-24 [1] CRAN (R 3.6.1)
## rlang 0.4.0 2019-06-25 [1] CRAN (R 3.6.1)
## rmarkdown 1.14 2019-07-12 [1] CRAN (R 3.6.1)
## rmdformats 0.3.5 2019-02-19 [1] CRAN (R 3.6.1)
## rpart 4.1-15 2019-04-12 [1] CRAN (R 3.6.1)
## rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.6.1)
## RSQLite 2.1.2 2019-07-24 [1] CRAN (R 3.6.1)
## rstudioapi 0.10 2019-03-19 [1] CRAN (R 3.6.1)
## S4Vectors * 0.22.0 2019-05-02 [1] Bioconductor
## scales 1.0.0 2018-08-09 [1] CRAN (R 3.6.1)
## segmented 1.0-0 2019-06-17 [1] CRAN (R 3.6.1)
## seriation * 1.2-7 2019-06-08 [1] CRAN (R 3.6.1)
## sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.1)
## shiny 1.3.2 2019-04-22 [1] CRAN (R 3.6.1)
## SRAdb 1.46.0 2019-05-02 [1] Bioconductor
## stringi 1.4.3 2019-03-12 [1] CRAN (R 3.6.1)
## stringr 1.4.0 2019-02-10 [1] CRAN (R 3.6.1)
## SummarizedExperiment * 1.14.1 2019-07-31 [1] Bioconductor
## survival 2.44-1.1 2019-04-01 [1] CRAN (R 3.6.1)
## testthat 2.2.1 2019-07-25 [1] CRAN (R 3.6.1)
## tibble 2.1.3 2019-06-06 [1] CRAN (R 3.6.1)
## tidyr 0.8.3 2019-03-01 [1] CRAN (R 3.6.1)
## tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.6.1)
## TSP 1.1-7 2019-05-22 [1] CRAN (R 3.6.1)
## UpSetR * 1.4.0 2019-05-22 [1] CRAN (R 3.6.1)
## usethis 1.5.1 2019-07-04 [1] CRAN (R 3.6.1)
## vctrs 0.2.0 2019-07-05 [1] CRAN (R 3.6.1)
## viper * 1.18.1 2019-05-30 [1] Bioconductor
## viridis 0.5.1 2018-03-29 [1] CRAN (R 3.6.1)
## viridisLite 0.3.0 2018-02-01 [1] CRAN (R 3.6.1)
## withr 2.1.2 2018-03-15 [1] CRAN (R 3.6.1)
## xfun 0.8 2019-06-25 [1] CRAN (R 3.6.1)
## XML 3.98-1.20 2019-06-06 [1] CRAN (R 3.6.1)
## xml2 1.2.2 2019-08-09 [1] CRAN (R 3.6.1)
## xtable 1.8-4 2019-04-21 [1] CRAN (R 3.6.1)
## XVector 0.24.0 2019-05-02 [1] Bioconductor
## yaml 2.2.0 2018-07-25 [1] CRAN (R 3.6.1)
## zeallot 0.1.0 2018-01-28 [1] CRAN (R 3.6.1)
## zlibbioc 1.30.0 2019-05-02 [1] Bioconductor
##
## [1] /home/ubuntu/R/x86_64-pc-linux-gnu-library/3.6
## [2] /usr/local/lib/R/site-library
## [3] /usr/lib/R/site-library
## [4] /usr/lib/R/library